import 'package:common/common.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';
import 'package:miaowu/app/common/window_pop/public_btn_tem.dart';
import 'package:miaowu/app/module/splash/privacy_policy_dialog.dart';

class WalletHelpWidget extends StatelessWidget {
  const WalletHelpWidget({super.key, required this.helpCoinItem});
  final PublicBtnItem helpCoinItem;

  @override
  Widget build(BuildContext context) {
    BtnClickWindow? window = helpCoinItem.click?.window;
    WindowBtn? closeItem = helpCoinItem.click?.window?.btns?.first;
    return Container(
      height: 450,
      decoration: BoxDecoration(
          color: Colors.white,
          borderRadius: BorderRadius.only(topLeft: Radius.circular(16.r), topRight: Radius.circular(16.r))),
      child: Stack(
        children: [
          Image.asset('assets/app/images/member/member_pay_bg.png'),
          Container(
            color: Colors.transparent,
            child: Column(
              children: [
                Padding(
                  padding: const EdgeInsets.symmetric(horizontal: 1, vertical: 13),
                  child: OverflowBar(
                    alignment: MainAxisAlignment.spaceBetween,
                    children: [
                      Expanded(
                        child: TextButton(
                          onPressed: () => Navigator.pop(context),
                          child: Image.asset('assets/app/images/member/member_pay_close.png', width: 15.sp),
                        ),
                      ),
                      Expanded(
                          child: Text(window?.main ?? '',
                              style: TextStyle(color: const Color(0xFF000000), fontSize: 17.sp))),
                      const Expanded(child: SizedBox(width: 60)),
                      // TextButton(
                      //   onPressed: () {
                      //     Navigator.pop(context);
                      //   },
                      //   child: const Text('确定', style: TextStyle(color: Color(0xFF25D4D0), fontSize: 17)),
                      // ),
                    ],
                  ),
                ),
                Expanded(
                  child: Padding(
                    padding: const EdgeInsets.symmetric(horizontal: 16),
                    child: ScrollConfiguration(
                        behavior: NoShadowScrollBehavior(),
                        child: SingleChildScrollView(
                          child: RichText(
                              text: TextSpan(
                            text: window?.desc ?? '',
                            style: TextStyle(
                                fontSize: 13.sp, color: Colors.black, fontWeight: FontWeight.w500, height: 1.4),
                            // children: [
                            // TextSpan(
                            //     style: TextStyle(
                            //         fontSize: 14, color: Color(0xFF515C5A), fontWeight: FontWeight.w500, height: 1.4),
                            //     text: '欢迎使用“Ai柚app”，'),
                            // ],
                          )),
                        )),
                  ),
                ),
                if (closeItem != null)
                  Container(
                    height: 51,
                    margin: const EdgeInsets.only(left: 20, right: 20, top: 20),
                    alignment: Alignment.center,
                    decoration: BoxDecoration(color: const Color(0xFF25D4D0), borderRadius: BorderRadius.circular(25)),
                    child: Text(
                      closeItem.btnTxt ?? '',
                      style: TextStyle(color: Colors.white, fontSize: 16.sp, fontWeight: FontWeight.w600),
                    ),
                  ).onTap(() {
                    Navigator.pop(context);
                  }),
                SizedBox(height: AppScreen.safeAreaPaddingBottom)
              ],
            ),
          ),
        ],
      ),
    );
  }
}
